<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="theme-color" content="#d4af37">
  <meta name="description" content="八字算命大师 - 专业的命理分析应用">
  <title>八字算命大师</title>
  
  <!-- PWA相关 -->
  <link rel="manifest" href="./manifest.json">
  <link rel="icon" type="image/svg+xml" href="/icon.svg">
  <link rel="apple-touch-icon" href="/icon-192.png">
  
  <!-- 移动端优化 -->
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="apple-mobile-web-app-title" content="算命大师">
  
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
      background: linear-gradient(135deg, #2c1810 0%, #3d2817 100%);
      color: white;
      overflow-x: hidden;
    }
    
    #app {
      min-height: 100vh;
    }
    
    /* 加载动画 */
    .loading {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(135deg, #2c1810 0%, #3d2817 100%);
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      z-index: 9999;
    }
    
    .loading-icon {
      font-size: 4rem;
      margin-bottom: 1rem;
      animation: pulse 2s infinite;
    }
    
    .loading-text {
      color: #d4af37;
      font-size: 1.2rem;
      font-weight: bold;
    }
    
    .loading-spinner {
      width: 40px;
      height: 40px;
      border: 4px solid rgba(212, 175, 55, 0.3);
      border-top: 4px solid #d4af37;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-top: 1rem;
    }
    
    @keyframes pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.1); }
    }
    
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    
    /* 隐藏加载动画 */
    .loading.hidden {
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.5s ease;
    }
  </style>
  <script type="module" crossorigin src="./assets/index-D6c6CdGk.js"></script>
  <link rel="modulepreload" crossorigin href="./assets/vendor-I3clgj6S.js">
  <link rel="stylesheet" crossorigin href="./assets/index-BHa_hzcm.css">
<link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head>
<body>
  <div id="app">
    <!-- 加载动画 -->
    <div class="loading" id="loading">
      <div class="loading-icon">🔮</div>
      <div class="loading-text">八字算命大师</div>
      <div class="loading-text" style="font-size: 0.9rem; margin-top: 0.5rem; opacity: 0.8;">正在加载中...</div>
      <div class="loading-spinner"></div>
    </div>
  </div>
  
  
  <script>
    // 页面加载完成后隐藏加载动画
    window.addEventListener('load', function() {
      setTimeout(function() {
        const loading = document.getElementById('loading');
        if (loading) {
          loading.classList.add('hidden');
          setTimeout(() => loading.remove(), 500);
        }
      }, 1000);
    });
    
    // 错误处理
    window.addEventListener('error', function(e) {
      console.error('页面错误:', e.error);
    });
    
    // 注册Service Worker
    if ('serviceWorker' in navigator) {
      window.addEventListener('load', () => {
        navigator.serviceWorker.register('/sw.js')
          .then(registration => {
            console.log('SW registered: ', registration);
          })
          .catch(registrationError => {
            console.log('SW registration failed: ', registrationError);
          });
      });
    }

    // Cordova设备就绪事件
    document.addEventListener('deviceready', function() {
      console.log('Cordova设备就绪')

      // 隐藏启动屏幕
      if (navigator.splashscreen) {
        navigator.splashscreen.hide()
      }

      // 设置状态栏
      if (window.StatusBar) {
        StatusBar.styleDefault()
      }
    }, false)
  </script>
</body>
</html>